package com.dragon.modules.yuegou.query.order;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.order.OrderJingdongEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 订单关联京东订单 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2022-01-14 09:50:49
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class OrderJingdongQuery extends OrderJingdongEntity implements Query<OrderJingdongEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 订单号查询条件 */
	@JsonUnwrapped(prefix = "orderNo")
	private Condition<String> orderNoCondition;

    /** 京东订单号查询条件 */
	@JsonUnwrapped(prefix = "jdOrderNo")
	private Condition<Long> jdOrderNoCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public OrderJingdongQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public OrderJingdongQuery(OrderJingdongEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public OrderJingdongQuery(OrderJingdongQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.orderNoCondition != null) {
			this.orderNoCondition = other.orderNoCondition.copy();
		}
		if(other.jdOrderNoCondition != null) {
			this.jdOrderNoCondition = other.jdOrderNoCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<OrderJingdongEntity> toQueryWrapper() {
		QueryWrapper<OrderJingdongEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (orderNoCondition != null) {
			orderNoCondition.toWrapper(wrapper, COL_ORDER_NO);
		}
		if (jdOrderNoCondition != null) {
			jdOrderNoCondition.toWrapper(wrapper, COL_JD_ORDER_NO);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回订单号查询条件
	 * 
	 * @return orderNoCondition 订单号查询条件
	 */
	public Condition<String> orderNo() {
		this.orderNoCondition = new Condition<>();
		return this.orderNoCondition;
	}
	
	/**
	 * 获取订单号查询条件
	 * 
	 * @return orderNoCondition 订单号查询条件
	 */
	public Condition<String> getOrderNoCondition() {
		return orderNoCondition;
	}

	/**
	 * 设置订单号查询条件
	 * 
	 * @param orderNoCondition 订单号查询条件
	 */
	public void setOrderNoCondition(Condition<String> orderNoCondition) {
		this.orderNoCondition = orderNoCondition;
	}

	/**
	 * 构造并返回京东订单号查询条件
	 * 
	 * @return jdOrderNoCondition 京东订单号查询条件
	 */
	public Condition<Long> jdOrderNo() {
		this.jdOrderNoCondition = new Condition<>();
		return this.jdOrderNoCondition;
	}
	
	/**
	 * 获取京东订单号查询条件
	 * 
	 * @return jdOrderNoCondition 京东订单号查询条件
	 */
	public Condition<Long> getJdOrderNoCondition() {
		return jdOrderNoCondition;
	}

	/**
	 * 设置京东订单号查询条件
	 * 
	 * @param jdOrderNoCondition 京东订单号查询条件
	 */
	public void setJdOrderNoCondition(Condition<Long> jdOrderNoCondition) {
		this.jdOrderNoCondition = jdOrderNoCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

}
